<%@page
	import="cn.edu.hust.sse.software7.class3.entities.EBCommonOnProduct"%>
<%@page import="cn.edu.hust.sse.software7.class3.entities.EBProduct"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<%
	EBProduct watchProd = (EBProduct) session.getAttribute("watchProd");
	List<EBCommonOnProduct> commonList = (List<EBCommonOnProduct>) session
			.getAttribute("prodCommonList");
%>
<table style="background-color: activeborder; width: 100%; border: medium;">
	<tr>
		<td rowspan="8"><img src="/image?type=3&id=<%=watchProd.getProductId() %>"/></td>
		<td>商品ID</td>
		<td><%=watchProd.getProductId()%></td>
	</tr>
	<tr>
		<td>商品名称</td>
		<td><%=watchProd.getProductName()%></td>
	</tr>
	<tr>
		<td>商品种类</td>
		<td><%=watchProd.getMyCategoryId()%></td>
	</tr>
	<tr>
		<td>商品价格</td>
		<td><%=watchProd.getLowestPrice()%></td>
	</tr>
	<tr>
		<td>运费</td>
		<td><%=watchProd.getTradingPrice()%></td>
	</tr>
	<tr>
		<td>一口成交价</td>
		<td><%=watchProd.getFreight()%></td>
	</tr>
	<tr>
		<td>商品数量</td>
		<td><%=watchProd.getMount()%></td>
	</tr>
	<tr>
		<td>商品描述</td>
		<td><%=watchProd.getProductDescription()%></td>
	</tr>
</table>
<b>Commons</b>
<br />
<%
	if (!commonList.isEmpty()) {
		for (EBCommonOnProduct common : commonList) {
%>
<div style="background-color: activeborder; border: medium; padding: 3px;">
<div style="background-color: activeborder; padding: 1px;" ><b>ID为<%=common.getCommonerId()%>的用户</b>&nbsp;:&nbsp;于<%=common.getCommonDate()%>对该商品进行评价。
</div>
<div style="background-color: silver; padding: 1px;"><%=common.getCommonContext()%></div>
</div>
<%
	}
	} else {
%>
<div>该商品没有评论</div>
<%
	}
%>
<div>
<form action="/common?method=add" method="post">
<div>评论：</div>
<div><textarea name="common" cols="100" rows="10"></textarea><input type="hidden" name="prodId" value="<%=watchProd.getProductId() %>"/></div>
<div><input type="reset" value="重置"/><input type="submit" value="添加评论"/>
</div>
</form>
</div>
</body>
</html>